import sys, os, art, string
from msvcrt import getch
class menu:
    def __main__(self):
        a=menu()
        b='buns'
        while b!='run':
            if os.name in ('nt', 'dos', 'cd'):
                os.system('color 1F')
            art.art_print(art.title)
            print '1. Play'
            print '2. Exit'
            c=raw_input('> ')
            try:
                c=string.upper(c)
            except:
                print 'ERROR'
            if c==1 or c=='1' or c=='PLAY' or c=='P':
                os.system('color 0F')
                b='run'
            elif c==2 or c=='2' or c=='EXIT' or c=='E':
                sys.exit()
            else:
                b='buns'
        a.clear()
        return b
        
    def pause(self):
        a=menu()
        if os.name in ('nt', 'dos', 'cd'):
            os.system('pause')
            a.clear()
        else:
            print 'Press Enter to Continue'
            raw_input('')
            a.clear()
    
    def clear(self,numlines=100):
        if os.name == "posix":
            os.system('clear')
        elif os.name in ("nt", "dos", "ce"):
            os.system('CLS')
        else:
            print '\n' * numlines
